Log in Register Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

cody's Profile Picture

cody

4270 Files

633460 Views

Latest files of /cody/swapnilsparsh/30DaysOfJavaScript/110 - Pixel to em Converter

style.css cody/swapnilsparsh/30DaysOfJavaScript/110 - Pixel to em Converter/style.css
101 Views
0 Comments
@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');
*{
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Poppins",sans-serif;
}
body{
index.html cody/swapnilsparsh/30DaysOfJavaScript/110 - Pixel to em Converter/index.html
281 Views
0 Comments
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pixel-EM Calculator</title>
<!-- Google Font -->
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap"
script.js cody/swapnilsparsh/30DaysOfJavaScript/110 - Pixel to em Converter/script.js
113 Views
0 Comments
let inpBase = document.getElementById("inp-base-px");
let inpPX = document.getElementById("inp-px");
let inpEM = document.getElementById("inp-em");

//Function to convert pixels to em
let pxToEm = () => {
let inpBaseValue = inpBase.value;
let pxValue = inpPX.value;